#define DATUM_OSGB36 86
#define DATUM_WGS84 118
+/* bit manipulation functions (util.c) */
+
+char getbit(const void *buf, const gbuint32 nr);
+void setbit(void *buf, const gbuint32 nr);
+
/*
* From parse.c
*/
return (res == NULL) ? (char *) fname : ++res;
}
+
+/* bit manipulation functions */
+
+/*
+ * setbit: Set bit number [nr] of buffer [buf]
+ */
+void setbit(void *buf, const gbuint32 nr)
+{
+ unsigned char *bytes = buf;
+ bytes[nr / 8] |= (1 << (nr % 8));
+}
+
+/*
+ * setbit: Get state of bit number [nr] of buffer [buf]
+ */
+char getbit(const void *buf, const gbuint32 nr)
+{
+ const unsigned char *bytes = buf;
+ return (bytes[nr / 8] & (1 << (nr % 8)));
+
+}
+